package com.best4cloud.user.domain;

import com.best4cloud.common.database.base.BaseAuditingEntity;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Data
@Entity
@Table(name = "sys_menu")
@SQLDelete(sql = "update sys_menu set deleted = 1 where id = ?")
@Where(clause = "deleted = 0")
public class SysMenu extends BaseAuditingEntity {

    /**
     * 菜单名称
     */
    @Column(nullable = false)
    private String name;

    /**
     * 权限名称
     */
    private String permission;

    /**
     * 前端路径
     */
    private String path;

    /**
     * 前端组件
     */
    private String component;

    /**
     * 父 ID
     */
    @Column(nullable = false)
    private Long parentId;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 菜单排序
     */
    private Integer sort;

    /**
     * 菜单类型 （类型   0：目录   1：菜单   2：按钮）
     */
    @Column(nullable = false)
    private Integer type;

    /**
     * 逻辑删除
     */
    private boolean deleted;

}
